package io.wongxd.demo.page.emo.ui.page

import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import io.modifier.basic.emo.device.getBatteryCapacity
import io.modifier.basic.emo.device.getDataStorageSize
import io.modifier.basic.emo.device.getExtraStorageSize
import io.modifier.basic.emo.device.getTotalMemory
import io.modifier.basic.emo.device.isHonor
import io.modifier.basic.emo.device.isHuawei
import io.modifier.basic.emo.device.isMeizu
import io.modifier.basic.emo.device.isOppo
import io.modifier.basic.emo.device.isVivo
import io.modifier.basic.emo.device.isXiaomi
import io.modifier.basic.emo.scheme.ComposeScheme
import io.wongxd.demo.page.emo.EmoMainActivity
import io.wongxd.demo.page.emo.config.SchemeConst
import io.wongxd.demo.page.emo.ui.CommonItem

@ComposeScheme(
    action = SchemeConst.SCHEME_ACTION_DEVICE,
    alternativeHosts = [EmoMainActivity::class]
)
@Composable
fun DevicePage() {
    val view = LocalView.current
    OnlyBackListPage(
        title = "Device"
    ) {
        item {
            CommonItem("是小米吗？ ${isXiaomi()}")
        }

        item {
            CommonItem("是华为吗？ ${isHuawei()}")
        }

        item {
            CommonItem("是荣耀吗？ ${isHonor()}")
        }

        item {
            CommonItem("是魅族吗？ ${isMeizu()}")
        }

        item {
            CommonItem("是Oppo吗？ ${isOppo()}")
        }

        item {
            CommonItem("是Vivo吗？ ${isVivo()}")
        }

        item {
            CommonItem("是Vivo吗？ ${isVivo()}")
        }

        item {
            CommonItem("总内存: ${getTotalMemory(LocalContext.current.applicationContext)}")
        }

        item {
            CommonItem("Data 存储容量: ${getDataStorageSize()}")
        }

        item {
            CommonItem("外部存储容量: ${getExtraStorageSize()}")
        }

        item {
            CommonItem("电池总存储: ${getBatteryCapacity(LocalContext.current.applicationContext)}")
        }
    }
}
